package com.ddtech.business.check.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ddtech.business.check.entity.Check;
import com.ddtech.business.check.entity.CheckUserQuestion;
import com.ddtech.business.check.entity.CheckUserRecord;
import com.ddtech.business.check.query.CheckQuery;
import com.ddtech.business.check.vo.req.AddCheck;
import com.ddtech.business.check.vo.req.CheckRecord;
import com.ddtech.business.check.vo.res.*;

import java.util.List;

/**
 * <p>
 * 考核表 服务类
 * </p>
 *
 * @author bin_pu
 * @since 2023-02-06
 */
public interface CheckService extends IService<Check> {
    /**
     * 创建
     *
     * @param addCheck
     */
    void create(AddCheck addCheck);

    /**
     * 分页
     *
     * @param checkQuery
     * @return
     */
    Object pageList(CheckQuery checkQuery);

    /**
     * 删除
     *
     * @param id
     */
    void del(String id);

    /**
     * 详情
     *
     * @param checkId
     * @return
     */
    AddCheck getInfo(String checkId);

    /**
     * 查询待考试列表
     * @return
     * @param type
     * @param date
     */
    TodoCheckRes getCheckList(Integer type, String date);

    /**
     * 考试
     *
     * @param checkId
     * @return
     */
    QueTypeRes exam(String checkId);

    /**
     * 提交
     * @param checkRecord
     * @return
     */
    CheckUserRecord commit(CheckRecord checkRecord);

    /**
     * 获取用户答题详情
     * @param recordId
     * @return
     */
    ResUserCheckDetail getUserExamDetail(String recordId);

    /**
     * 获取排名
     * @param checkId
     * @param userName
     * @param pageableRequest
     * @return
     */
    ResRank getRank(String checkId,String userName, IPage pageableRequest);

    /**
     *查询考试记录
     * @return
     * @param page
     * @param size
     * @param type
     * @param inputSearch
     */
    Object getUserExam(int page,int size, Integer type, String inputSearch);

    /**
     * getTypeQuestion
     * @param userId
     * @param questionList
     * @return
     */
    List<QueAndOpt> getTypeQuestion(String userId, List<CheckUserQuestion> questionList);

    /**
     * 考试数据统计
     * @param type
     * @return
     */
    Object getUserExamStatistics(Integer type);
}
